/*
 * File: exercise1.cpp
 * -------------------
 * iomanip for output format
 * compile command :
 * g++ -Wall -g exercise1.cpp -o exercise1 -lStanfordCPPLib -I ../include/
 */

#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

double sind(double);
double cosd(double);
int main()
{
	cout<< " theta |  sin(theta)  |  cos(theta)  |"<<endl;
	cout<<"-------------------------------------+"<<endl;
	for(int i = -90; i <= 90; i+=15)
		cout<<fixed<<setw(6)<<i<<" | "<<fixed<<setw(12)<<sind(double(i))<<" | "<<setw(12)<<cosd(double(i))<<" | "<<endl;
	return 0;
}

double sind(double angle)
{
	double angleradians = angle * M_PI / 180.0f;
	return sin(angleradians);
}

double cosd(double angle)
{
	double angleradians = angle * M_PI / 180.0f;
	return cos(angleradians);
}
